package thang.map.control;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;

import openones.corewa.BaseOutForm;

import org.apache.log4j.Logger;

import rocky.mvcportlet.control.BaseControl;
import thang.map.dao.GetData;

public class MenuControl extends BaseControl {

    static final Logger LOG = Logger.getLogger("MenuControl");
    
    /*public BaseOutForm procListT (ActionRequest request,Map<String, Object> reqMap, ActionResponse response) throws PortletException, IOException{
        GetData GD = new GetData();
        List result = GD.Get();
        int length = result.size();
     
        
        BaseOutForm resultForm = new BaseOutForm();
        resultForm.putRequest("newlist", result);
        LOG.debug("result[0] :" + result.get(0));
        resultForm.putRequest("lengthlist", length);
        LOG.debug("length of result :" + length);
        return resultForm;
    }*/
    
    public BaseOutForm procListT (ActionRequest request,Map<String, Object> reqMap, ActionResponse response) throws PortletException, IOException{
        GetData GD = new GetData();
        List result = GD.Get();
        int length = result.size();
     
        
        BaseOutForm resultForm = new BaseOutForm();
        resultForm.putSession("newlist", result);
        LOG.debug("result[0] :" + result.get(0));
        resultForm.putSession("lengthlist", length);
        LOG.debug("length of result :" + length);
        
        /*resultForm.putRequest("newlist", result);
        LOG.debug("result[0] :" + result.get(0));
        resultForm.putRequest("lengthlist", length);
        LOG.debug("length of result :" + length);*/
        return resultForm;
    }
}
